<%@page import="tk.zater.Util.ApplicationGetter"%>
<%@page import="tk.zater.CS.Constant"%>
<%@page import="tk.zater.Base64"%>
<jsp:useBean id="base64" scope="session" class="tk.zater.Base64" />
<%
	Constant us = (Constant) ApplicationGetter.Getbean("LoginInInformation");
	if (request.getHeader("Authorization") == null) {
		response.setStatus(401);
		response.setHeader("WWW-authenticate", "Basic realm=user information");
	} else {
		String encoded = (request.getHeader("Authorization"));
		String tmp = encoded.substring(6);
		String up = Base64.decode(tmp);

		String user = "";
		String password = "";
		if (up != null) {
			user = up.substring(0, up.indexOf(":"));
			password = up.substring(up.indexOf(":") + 1);
		}
		if (us.Username.equals(user) && us.Password.equals(password)) {
			//???? 
			// out.println("true");
		} else {
			response.setStatus(401);
			response.setHeader("WWW-authenticate", "Basic realm=\"please input the input information\"");

		}
	}
%>

